home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / il / ilKernel.z / ilKernel
Encoding:
Text File  |  2002-10-03  |  14.2 KB  |  397 lines

  1.  
  2.  
  3.  
  4. iiiillllKKKKeeeerrrrnnnneeeellll((((3333))))        IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll        iiiillllKKKKeeeerrrrnnnneeeellll((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      iiiillllKKKKeeeerrrrnnnneeeellll - class to define a kernel
  10.  
  11. IIIINNNNHHHHEEEERRRRIIIITTTTSSSS FFFFRRRROOOOMMMM
  12.      ilWatchedObject
  13.  
  14. HHHHEEEEAAAADDDDEEEERRRR FFFFIIIILLLLEEEE
  15.      #include <il/ilKernel.h>
  16.  
  17. CCCCLLLLAAAASSSSSSSS DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  18.      ilKernel is the base class for deriving a three-dimensional kernel.  An
  19.      ilKernel is defined by an _x, _y, and _z dimension, a data type, the kernel
  20.      data, and the kernel origin. ilKernel also provides functions to access
  21.      kernel attributes and data.
  22.  
  23.      An ilKernel is conceptually equivalent to a three-dimensional  matrix
  24.      whose elements are stored in row major form. Additionally, a kernel can
  25.      have an origin, typically at the center of the matrix.
  26.  
  27.      ilKernel, by default, defines a general kernel. iiiillllSSSSeeeeppppKKKKeeeerrrrnnnneeeellll is a
  28.      separable kernel derived from ilKernel.
  29.  
  30.  
  31. CCCCLLLLAAAASSSSSSSS MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN SSSSUUUUMMMMMMMMAAAARRRRYYYY
  32.      CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrrssss
  33.  
  34.           ilKernel(iflDataType type, void *d=NULL, int x=1, int y=1,
  35.                    int z=1)
  36.           ilKernel()     _p_r_o_t_e_c_t_e_d
  37.  
  38.  
  39.      FFFFuuuunnnnccccttttiiiioooonnnnssss ttttoooo sssseeeetttt////ggggeeeetttt kkkkeeeerrrrnnnneeeellll aaaattttttttrrrriiiibbbbuuuutttteeeessss
  40.  
  41.           int getXsize()
  42.           int getYsize()
  43.           int getZsize()
  44.           void getSize(int& x, int& y, int& z)
  45.           void getOrigin(int &x, int &y, int &z)
  46.           void setOrigin(int x, int y, int z)
  47.           iflDataType getDataType()
  48.           ilKernelType getKernelType()
  49.           virtual int isEquivalent(const ilKernel *otherKernel)
  50.           void setClamp(int on=TRUE)
  51.           int isClampSet()
  52.  
  53.  
  54.      GGGGeeeettttttttiiiinnnngggg aaaannnndddd sssseeeettttttttiiiinnnngggg kkkkeeeerrrrnnnneeeellll ddddaaaattttaaaa
  55.  
  56.           virtual double getElement(int x, int y=0, int z=0)
  57.           virtual void setElement(double val, int x, int y=0, int z=0)
  58.           void *getData()
  59.           void setData(const void *data)
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. iiiillllKKKKeeeerrrrnnnneeeellll((((3333))))        IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll        iiiillllKKKKeeeerrrrnnnneeeellll((((3333))))
  71.  
  72.  
  73.  
  74.           virtual void scale(double s)
  75.           virtual ilKernel* copy()
  76.  
  77.  
  78.      UUUUttttiiiilllliiiittttyyyy ffffuuuunnnnccccttttiiiioooonnnnssss
  79.  
  80.           virtual void operator=(const ilKernel &kernel)
  81.           void init(iflDataType type, void* d=NULL, int x=1, int y=1,
  82.                     int z=1)  _p_r_o_t_e_c_t_e_d
  83.           double getVal(int i)     _p_r_o_t_e_c_t_e_d
  84.           void setVal(double val, int i)     _p_r_o_t_e_c_t_e_d
  85.           int offset(int x)   _p_r_o_t_e_c_t_e_d
  86.           int offset(int x, int y, int z)    _p_r_o_t_e_c_t_e_d
  87.           virtual void calcGain(double& min, double& max)
  88.           void calcPassGain(int off, int len, double& min, double& max)    _p_r_o_t_e_c_t_e_d
  89.  
  90.  
  91. FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNNSSSS
  92.      iiiillllKKKKeeeerrrrnnnneeeellll(((())))
  93.  
  94.           ilKernel(iflDataType type, void *d=NULL, int x=1, int y=1,
  95.                    int z=1)
  96.           ilKernel()     _p_r_o_t_e_c_t_e_d
  97.  
  98.  
  99.           Construct a kernel by copying user data, assumed to be in row major
  100.           order.  If the pointer _d_a_t_a is NULL, memory is still allocated in
  101.           the specified size, but no data is copied.  By default, the kernel
  102.           origin is set to (x/2, y/2, z/2), and the kernel type is
  103.           _i_l_K_e_r_n_G_e_n_e_r_a_l.
  104.  
  105.           The second form of the constructor is used for derived classes, it
  106.           creates an unitialized object.
  107.  
  108.      ccccaaaallllccccGGGGaaaaiiiinnnn(((())))
  109.  
  110.           virtual void calcGain(double& min, double& max)
  111.  
  112.  
  113.           This method calculates the worst case gain applied to an input
  114.           range, the passed in _m_i_n and _m_a_x values are updated with the result
  115.           of applying the worst case gain.
  116.  
  117.      ccccaaaallllccccPPPPaaaassssssssGGGGaaaaiiiinnnn(((())))
  118.  
  119.           void calcPassGain(int off, int len, double& min, double& max)    _p_r_o_t_e_c_t_e_d
  120.  
  121.  
  122.           Used to compute the worst case gain for a segment of the kernel data
  123.           vector indicated by _o_f_f and _l_e_n.  The passed in _m_i_n and _m_a_x values
  124.           are updated with the result of applying the worst case gain.
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. iiiillllKKKKeeeerrrrnnnneeeellll((((3333))))        IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll        iiiillllKKKKeeeerrrrnnnneeeellll((((3333))))
  137.  
  138.  
  139.  
  140.      ccccooooppppyyyy(((())))
  141.  
  142.           virtual ilKernel* copy()
  143.  
  144.  
  145.           Constructs a kernel which is a copy of this kernel.  The kernel data
  146.           is copied into the returned object.
  147.  
  148.      ggggeeeettttDDDDaaaattttaaaa(((())))
  149.  
  150.           void *getData()
  151.  
  152.  
  153.           Returns a pointer to the kernel data.  Use the kernel data type to
  154.           cast pointer to the correct type.
  155.  
  156.      ggggeeeettttDDDDaaaattttaaaaTTTTyyyyppppeeee(((())))
  157.  
  158.           iflDataType getDataType()
  159.  
  160.  
  161.           Returns the type of the kernel data.
  162.  
  163.      ggggeeeettttEEEElllleeeemmmmeeeennnntttt(((())))
  164.  
  165.           virtual double getElement(int x, int y=0, int z=0)
  166.  
  167.  
  168.           Returns one element from the kernel data, indexed by _x, _y, _a_n_d _z.
  169.  
  170.      ggggeeeettttKKKKeeeerrrrnnnneeeellllTTTTyyyyppppeeee(((())))
  171.  
  172.           ilKernelType getKernelType()
  173.  
  174.  
  175.           Returns the kernel type, _i_l_K_e_r_n_G_e_n_e_r_a_l for a general kernel, and
  176.           _i_l_K_e_r_n_S_e_p_a_r_a_b_l_e for a separable kernel.
  177.  
  178.      ggggeeeettttOOOOrrrriiiiggggiiiinnnn(((())))
  179.  
  180.           void getOrigin(int &x, int &y, int &z)
  181.  
  182.  
  183.           Returns the kernel's origin in _x, _y, _z.
  184.  
  185.      ggggeeeettttSSSSiiiizzzzeeee(((())))
  186.  
  187.           void getSize(int& x, int& y, int& z)
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. iiiillllKKKKeeeerrrrnnnneeeellll((((3333))))        IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll        iiiillllKKKKeeeerrrrnnnneeeellll((((3333))))
  203.  
  204.  
  205.  
  206.           Returns the kernel's (x,y,z) size in _x, _y, and _z respectively.
  207.  
  208.      ggggeeeettttVVVVaaaallll(((())))
  209.  
  210.           double getVal(int i)     _p_r_o_t_e_c_t_e_d
  211.  
  212.  
  213.           Treating the data pointed to by _d_a_t_a as a single dimensional array,
  214.           the method returns the _ith element as a double.
  215.  
  216.      ggggeeeettttXXXXssssiiiizzzzeeee(((())))
  217.  
  218.           int getXsize()
  219.  
  220.  
  221.           Returns the _x dimension of the kernel.
  222.  
  223.      ggggeeeettttYYYYssssiiiizzzzeeee(((())))
  224.  
  225.           int getYsize()
  226.  
  227.  
  228.           Returns the _y dimension of the kernel.
  229.  
  230.      ggggeeeettttZZZZssssiiiizzzzeeee(((())))
  231.  
  232.           int getZsize()
  233.  
  234.  
  235.           Returns the _z dimension of the kernel.
  236.  
  237.      iiiinnnniiiitttt(((())))
  238.  
  239.           void init(iflDataType type, void* d=NULL, int x=1, int y=1,
  240.                     int z=1)  _p_r_o_t_e_c_t_e_d
  241.  
  242.  
  243.           This method reinitializes the kernel to have the specified
  244.           attributes.  The data type will be set to _t_y_p_e, the size to _x, _y,
  245.           and _z, and the data will be copied from _d, or initialized to all
  246.           ones, if _d is NULL.
  247.  
  248.      iiiissssCCCCllllaaaammmmppppSSSSeeeetttt(((())))
  249.  
  250.           int isClampSet()
  251.  
  252.  
  253.           This method returns TRUE if this kernel is intended for use with
  254.           clamping.
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. iiiillllKKKKeeeerrrrnnnneeeellll((((3333))))        IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll        iiiillllKKKKeeeerrrrnnnneeeellll((((3333))))
  269.  
  270.  
  271.  
  272.      iiiissssEEEEqqqquuuuiiiivvvvaaaalllleeeennnntttt(((())))
  273.  
  274.           virtual int isEquivalent(const ilKernel *otherKernel)
  275.  
  276.  
  277.           Returns TRUE if _o_t_h_e_r_K_e_r_n_e_l has the same dimensions, data type, and
  278.           data of this kernel, and returns FALSE otherwise.
  279.  
  280.      ooooffffffffsssseeeetttt(((())))
  281.  
  282.           int offset(int x, int y, int z)    _p_r_o_t_e_c_t_e_d
  283.           int offset(_i_n_t _x)   _p_r_o_t_e_c_t_e_d
  284.  
  285.  
  286.           Returns the number of bytes offset from the beginning of the kernel
  287.           data to the element at location (x, y, z).  The second form treats
  288.           the kernel data as a one dimensional vector.
  289.  
  290.      ooooppppeeeerrrraaaattttoooorrrr====(((())))
  291.  
  292.           virtual void operator=(const ilKernel &kernel)
  293.  
  294.  
  295.           Copies the contents of _k_e_r_n_e_l into this kernel, reallocating data if
  296.           the size of new kernel data differs from the current size.
  297.  
  298.      ssssccccaaaalllleeee(((())))
  299.  
  300.           virtual void scale(double s)
  301.  
  302.  
  303.           This method scales all the kernel weights by _s.
  304.  
  305.      sssseeeettttCCCCllllaaaammmmpppp(((())))
  306.  
  307.           void setClamp(int on=TRUE)
  308.  
  309.  
  310.           This method is used to indicate that the kernel is intended to be
  311.           used with clamping, the values returned by ccccaaaallllccccGGGGaaaaiiiinnnn() will then be
  312.           simply adjusted for the kernel gain, not for the worst case
  313.           behavior.
  314.  
  315.      sssseeeettttDDDDaaaattttaaaa(((())))
  316.  
  317.           void setData(const void *data)
  318.  
  319.  
  320.           Copies _d_a_t_a into the kernel. The data is assumed to be of the type
  321.           and dimensions corresponding to the size and type used in the kernel
  322.           construction.
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. iiiillllKKKKeeeerrrrnnnneeeellll((((3333))))        IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll        iiiillllKKKKeeeerrrrnnnneeeellll((((3333))))
  335.  
  336.  
  337.  
  338.      sssseeeettttEEEElllleeeemmmmeeeennnntttt(((())))
  339.  
  340.           virtual void setElement(double val, int x, int y=0, int z=0)
  341.  
  342.  
  343.           Sets one element from the kernel data, indexed by _x, _y, _a_n_d _z. _t_o
  344.           _v_a_l.
  345.  
  346.      sssseeeettttOOOOrrrriiiiggggiiiinnnn(((())))
  347.  
  348.           void setOrigin(int x, int y, int z)
  349.  
  350.  
  351.           Set the kernel origin to (x, y, z);
  352.  
  353.      sssseeeettttVVVVaaaallll(((())))
  354.  
  355.           void setVal(double val, int i)     _p_r_o_t_e_c_t_e_d
  356.  
  357.  
  358.           Treating the data pointed to by _d_a_t_a as a single dimensional array,
  359.           the method sets the _ith element to _v_a_l.
  360.  
  361. IIIINNNNHHHHEEEERRRRIIIITTTTEEEEDDDD MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNNSSSS
  362.    IIIInnnnhhhheeeerrrriiiitttteeeedddd ffffrrrroooommmm iiiillllWWWWaaaattttcccchhhheeeeddddOOOObbbbjjjjeeeecccctttt
  363.      addWatchCallback(), doWatchCallbacks(), removeWatchCallback()
  364.  
  365. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  366.      ilSepKernel
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.